import { createApp } from "vue";
import { createPinia } from "pinia";
import piniaPluginPersistedstate from "pinia-plugin-persistedstate";
import router from "./router";
import App from "./App.vue";

// Element Plus
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import "md-editor-v3/lib/style.css";

// Bootstrap CSS and JS
import "bootstrap/dist/css/bootstrap.min.css";
import "bootstrap/dist/js/bootstrap.bundle.min.js";

// Custom styles
import "./assets/styles/main.css";
import "./assets/styles/login.css";
import "./assets/styles/element-plus.scss";
import "./assets/styles/view-standard.scss";

const app = createApp(App);
const pinia = createPinia();

// 配置 Pinia 持久化插件
pinia.use(piniaPluginPersistedstate);

// 注册Element Plus
app.use(ElementPlus);

// 注册所有图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}

app.use(pinia);
app.use(router);

app.mount("#app");
